Ubuntu 16.04
Sponsored Link

Nagios : Add Monitoring Target Host#2 (Ubuntu)
2016/06/08
 
It's possible to monitor other servers on the network not only with simply Ping command but services on them.
[1] Install nrpe on a target host you'd like to monitor services on it.
root@node01:~#
apt-get -y install nagios-nrpe-server
root@node01:~#
vi /etc/nagios/nrpe.cfg
# line 81: add access permission (specify Nagios server)

allowed_hosts=127.0.0.1
,10.0.0.30
# line 221: comment out and add

command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
#
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /

command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 150 -c 200
root@node01:~#
systemctl restart nagios-nrpe-server

[2] Configure Nagios server.
root@dlp:~#
apt-get -y install nagios-nrpe-plugin
root@dlp:~#
vi /etc/nagios3/conf.d/node01.cfg
# create new

define host{
    use                    generic-host
    host_name              node01
    alias                  node01
    address                10.0.0.51
    }
define service{
    use                    generic-service
    host_name              node01
    service_description    PING
    check_command          check_ping!100.0,20%!500.0,60%
    }
# for free disk

define service{
    use                    generic-service
    host_name              node01
    service_description    Root Partition
    check_command          check_nrpe_1arg!check_disk
    }
# for current users

define service{
    use                    generic-service
    host_name              node01
    service_description    Current Users
    check_command          check_nrpe_1arg!check_users
    }
# for total processes

define service{
    use                    generic-service
    host_name              node01
    service_description    Total Processes
    check_command          check_nrpe_1arg!check_total_procs
    }
# for current load

define service{
    use                    generic-service
    host_name              node01
    service_description    Current Load
    check_command          check_nrpe_1arg!check_load
    }

root@dlp:~#
systemctl restart nagios3

[3] It's possible to view the status for a new server on the admin site.
 
Tweet